<template>
	<div class="refundmanage">
		<!-- <div >sss</div> -->
		<el-radio-group class="headradioBtn_type" v-model="headradioBtn_type.radio"   @change="headradioBtnchange_type">
			<el-radio-button label="报名退费" class="first"></el-radio-button>
			<el-radio-button label="商品退费"></el-radio-button>
			<el-radio-button label="订金退费"></el-radio-button>
		</el-radio-group>
		<div class="content">
			<div class="t-title">{{topTitle}}</div>
			<div class="tablebox">
				<div class="headcontrolsbox">
					<div class="left">
						<template>
							<el-select class="payeeselect comSearchInput" v-model="headControls.payee.select" style="display:none;"
								clearable collapse-tags  placeholder="收款人" @change="payeeSelectChange">
								<el-option
								v-for="item in headControls.payee.data"
								:key="item.value"
								:label="item.label"
								:value="item.value">
								</el-option>
							</el-select>
						</template>
						<el-input class="paraminput comSearchInput"  ref="inputKeyWords"
							placeholder="搜索 学员姓名、联系电话"
							suffix-icon="el-icon-search"
							v-model="headControls.param"
							clearable
							@clear="inputKeyWordsClear"
							@keyup.enter.native="queryBtnClick">
						</el-input>
						<!-- <el-button class="query" @click="queryBtnClick">查询</el-button> -->
						<div class="search_btn" @click="queryBtnClick">搜索</div>
					</div>
					<div class="right">
						<el-date-picker
							v-model="headControls.timeselect.selfTime" @change="updateSelfTime"
							type="datetimerange"
							ref="selfTime"
							range-separator="至"
							start-placeholder="开始日期" 
							end-placeholder="结束日期">
						</el-date-picker>
						<el-radio-group class="timeselect" v-model="headControls.timeselect.radio"   @change="timeselectchange">
							<el-radio-button label="今日"></el-radio-button>
							<el-radio-button label="本周"></el-radio-button>
							<el-radio-button label="本月"></el-radio-button>
							<el-radio-button label="自定义" ref="selfBtn"></el-radio-button>
						</el-radio-group>
						<el-button class="query" v-show="false" disabled @click="outputExcelBtnClick">导出</el-button>
					</div>
				</div>
				<template>
					<el-table
						v-show="topTitle=='报名退费'"
						:data="moneyTableData"
						stripe
						style="width: 100%;font-size:0.16rem;"
						class="moneyTable"
						>
						<el-table-column
						prop="orderRefundEntity.orderRefundId"
						width="220"
						label="订单号">
						</el-table-column>
						<el-table-column
						prop="createTime"
						label="退课日期">
						</el-table-column>
						<el-table-column
						prop="studentName"
						label="学员姓名">
						</el-table-column>
						<el-table-column
						prop="studentNo"
						label="学号">
						</el-table-column>
						<el-table-column
						prop="className"
						label="课程名称">
						<template slot-scope="scope">
							<span>{{scope.row.courseName}}</span>
							<span v-if="scope.row.className"><br>{{scope.row.className}}</span>
						</template>
						</el-table-column>
						<!-- <el-table-column
						prop="orderNo"
						label="合同号">
						</el-table-column> -->
						<el-table-column
						prop="realMoney"
						label="退课金额">
							<template slot-scope="scope">
								<span>￥{{scope.row.realMoney}}</span>
							</template>
						</el-table-column>
						<el-table-column
						prop="createUserName"
						label="退课人">
						</el-table-column>
						<el-table-column
						prop="moneyStatu"
						label="状态">
							<template slot-scope="scope">
								<span v-if="scope.row.orderRefundState==1">待审核</span>
								<span v-else-if="scope.row.orderRefundState==2">已退款</span>
								<span v-else-if="scope.row.orderRefundState==3">退费驳回</span>
								<span v-else>已退款</span>
							</template>
						</el-table-column>
						<el-table-column
						prop="query"
						label="操作">
						<template slot-scope="scope">
							<el-button style="font-size:0.16rem;" @click="moneyTableRowClick(scope.row)" type="text" size="medium">查看</el-button>
							<el-button style="font-size:0.16rem;" v-if="scope.row.orderRefundState==1" @click="checkTableRow(scope.row)" type="text" size="medium">审核</el-button>
						</template>
						</el-table-column>

					</el-table>
					<el-table
						v-show="topTitle=='商品退费'"
						:data="moneyTableData"
						stripe
						style="width: 100%;font-size:0.16rem;"
						class="moneyTable"
						>
						<el-table-column
						prop="orderRefundEntity.orderRefundId"
						width="220"
						label="订单号">
						</el-table-column>
						<el-table-column
						prop="createTime"
						label="退费日期">
						</el-table-column>
						<el-table-column
						prop="studentName"
						label="学员姓名">
						</el-table-column>
						<el-table-column
						prop="studentNo"
						label="学号">
						</el-table-column>
						<el-table-column
						prop="refundGoodsData_goodsName"
						label="商品">
						</el-table-column>
						<el-table-column
						prop="receiptNo"
						label="收据号">
						</el-table-column>
						<el-table-column
						prop="realMoney"
						label="退款金额">
							<template slot-scope="scope">
								<span>￥{{scope.row.realMoney}}</span>
							</template>
						</el-table-column>
						<el-table-column
						prop="createUserName"
						label="退款人">
						</el-table-column>

						<el-table-column
						prop="query"
						label="操作">
						<template slot-scope="scope">
							<el-button style="font-size:0.16rem;" @click="moneyTableRowClick(scope.row)" type="text" size="medium">查看</el-button>
							<!-- <el-button style="font-size:0.16rem;" v-if="scope.row.checkshow" @click="checkTableRow(scope.row)" type="text" size="medium">审核</el-button> -->
						</template>
						</el-table-column>

					</el-table>
					<el-table
						v-show="topTitle=='订金退费'"
						:data="moneyTableData"
						stripe
						style="width: 100%;font-size:0.16rem;"
						class="moneyTable"
						>
						<el-table-column
						prop="orderRefundEntity.orderRefundId"
						width="220"
						label="订单号">
						</el-table-column>
						<el-table-column
						prop="createTime"
						label="退费日期">
						</el-table-column>
						<el-table-column
						prop="studentName"
						label="学员姓名">
						</el-table-column>
						<el-table-column
						prop="studentNo"
						label="学号">
						</el-table-column>
						<!-- <el-table-column
						prop="className"
						label="课程名称">
						</el-table-column> -->
						<el-table-column
						prop="orderNo"
						label="收据号">
						</el-table-column>
						<el-table-column
						prop="realMoney"
						label="退款金额">
							<template slot-scope="scope">
								<span>￥{{scope.row.realMoney}}</span>
							</template>
						</el-table-column>
						<el-table-column
						prop="createUserName"
						label="退款人">
						</el-table-column>

						<el-table-column
						prop="query"
						label="操作">
						<template slot-scope="scope">
							<el-button style="font-size:0.16rem;" @click="moneyTableRowClick(scope.row)" type="text" size="medium">查看</el-button>
							<!-- <el-button style="font-size:0.16rem;" v-if="scope.row.checkshow" @click="checkTableRow(scope.row)" type="text" size="medium">审核</el-button> -->
						</template>
						</el-table-column>

					</el-table>
				</template>
				<div class="bottomControlsBox">
					<div class="totalBox">
						<span class="txt">{{totalSum.txt}}</span>
						<span class="unit">￥</span>
						<span class="number">{{totalSum.number}}</span>
					</div>
					<el-pagination
						:page-sizes="[10, 20, 30, 40,50,100]"
						:page-size="searchListParam.pageSize"
						layout="total, sizes, prev, pager, next, jumper"
						:total="pagination.total"
						:current-page="searchListParam.currPage"
						@current-change="handleCurrentChange"
						@size-change="handleSizeChange">
					</el-pagination>
				</div>
				
				
			</div>
			<el-dialog
				class="checkpopup"
				:modal="false"
				:close-on-click-modal="false"
				title="确定该笔订单已退款吗？"
				:visible.sync="checkPopup.visible">
				<el-row>
					<span>订单号：</span>
					<span>{{checkPopup.orderNo}}</span>
				</el-row>
				<el-row>
					<span>退款金额：</span>
					<span>￥{{checkPopup.money}}</span>
				</el-row>
				<el-row>
					<span>退款人：</span>
					<span>{{checkPopup.payee}}</span>
				</el-row>
				<span slot="footer" class="dialog-footer">
					<el-button @click="checkPopup.visible = false">取 消</el-button>
					<el-button @click="checkOrders">确 定</el-button>
				</span>
			</el-dialog>
			<el-dialog class="chargespopup" :title="moneyDetailsPopup.title" :visible.sync="moneyDetailsPopup.visible"
				:center="moneyDetailsPopup.operationType==2">
				<chargespopup ref="chargespopup" :chargespopup='moneyDetailsPopup.data'
				 @hideMe="hideChargesPopup" @success="updateMoneyList"></chargespopup>
			</el-dialog>
		</div>
		
		
	</div>
</template>

<script>
import chargespopup from './common/chargespopup'
	export default{
		components:{chargespopup},
		// props:[''],
		data(){
			return {
				topTitle:'报名退费',
				/**退费列表：全局搜索条件 */
				searchListParam:{
					campusId:this.$store.state.campusId,
					pageSize:10,
					queryType:2,
					billMode:'',
					accountUserId:'',
					currPage:1,
					payMode:'',
					keyName:'',
					startTime:'',
					endTime:''
				},
				headradioBtn_type:{
					radio:'报名退费'
				},
				headControls:{
					payee:{
						createUserNameList:[],
						data:[],
						select:''
					},
					param:'',
					timeselect:{
						radio:'今日',
						pre_radio:'今日',
						selfTime:[new Date(), new Date()]
					}
				},
				moneyTableData: [],
				/**分页 */
				pagination:{
					total:0
				},
				totalSum:{
					txt:'课程退费总额：',
					number:0
				},
				//费用详情、退费详情弹窗
				moneyDetailsPopup:{
					visible:false,
					title:'退费详情',
					data:null,
					operationType:0
				},
				checkPopup:{
					visible:false,
					orderNo:'CN001',
					money:1200,
					payee:'张无忌'
				},
			};
		},
		methods:{
			init(){
				let dict=JSON.parse(tool.getItem(window.lsKey.dict));
				this._billmode=dict.bill_mode;
				// console.log(dict)

				this.resetSearchParam();//重置搜索条件

				// let today=tool.getTimeObjByType(1);
				// this.searchListParam.startTime=today.startTime;
				// this.searchListParam.endTime=today.endTime;
				// this.headControls.timeselect.radio='今日';

				this.searchListParam.billMode=2;
				this.updateMoneyList();//收费列表
			},
			campusChange : function(campusId) { //校区改变
				this.searchListParam.campusId = campusId;
				this.init();
			},
			/**重置搜索条件（包括输入框的文本） */
			resetSearchParam(){
				//重置翻页
				this.searchListParam.pageSize=10;
				this.searchListParam.currPage=1;
				//重置时间
				let today=tool.getTimeObjByType(1);
				this.searchListParam.startTime=today.startTime;
				this.searchListParam.endTime=today.endTime;
				this.headControls.timeselect.radio='今日';
				//重置输入框
				this.searchListParam.keyName='';
				this.headControls.param='';
				// this.searchListParam.accountUserId='';
				// this.headControls.payee.select='';
				// this.searchListParam.payMode='';
				// this.headradioBtn_money.radio='总收款';
				// this.searchListParam.billMode='';
				// this.headradioBtn_type.radio='全部收费';
				// this.topTitle='全部收费';

			},
			/**更新收费列表数据
			 * pageSize 每页几条记录
			 * currPage 当前页号，1开始
			 * payMode 支付类型
			 * keyName 搜索关键字
			 * startTime 开始时间(可选)
			 * endTime 结束时间(可选)
			 */
			updateMoneyList(currPage){
				let self=this;
				this.searchListParam.currPage=1;
				if(currPage){
					this.searchListParam.currPage=currPage;
				}
				api.moneyList(this.searchListParam)
				.then(function(d){
					// console.log(d)
					if(d.result=='操作成功'){
						//初始化翻页
						self.pagination.total=d.totalCount;
						for(let i=0;i<d.list.length;i++){
							d.list[i].billModeName=self.matchBillMode(d.list[i].billMode);
							if(!self.headControls.payee.createUserNameList.includes(d.list[i].createUserName)){
								self.headControls.payee.createUserNameList.push(d.list[i].createUserName)
							}
							//报名退费审核 orderRefundState
							if(d.list[i].orderRefundEntity)
								d.list[i].orderRefundState=d.list[i].orderRefundEntity.orderRefundState;

							//商品收费处理
							if(self.searchListParam.billMode==5&&d.list[i].refundGoodsData&&d.list[i].refundGoodsData.length>0){
								// debugger
								let goodsName=d.list[i].refundGoodsData[0].goodsName;
								let goodsNum=0,goodsTotalMoney=0;
								if(d.list[i].refundGoodsData.length>1){
									let j=1;
									while(goodsName===''){
										goodsName=d.list[i].refundGoodsData[j].goodsName;
										j++;
										if(j==d.list[i].refundGoodsData.length)break;
									}
									if(goodsName!=='')
										goodsName+='...';
								}
								d.list[i].refundGoodsData.forEach(ele=>{
									goodsNum+=ele.goodsNum;
									goodsTotalMoney+=ele.realMoney;
								});
								d.list[i].refundGoodsData_goodsName=goodsName;
								d.list[i].refundGoodsData_goodsNum=goodsNum;
								d.list[i].refundGoodsData_goodsTotalMoney=goodsTotalMoney;
							}
						}
						self.headControls.payee.data=[];
						for(let i=0;i<self.headControls.payee.createUserNameList.length;i++){
							self.headControls.payee.data.push({
								value: self.headControls.payee.createUserNameList[i],
								label: self.headControls.payee.createUserNameList[i]
							});
						}
						self.totalSum.number=d.totalMoney||0;
						self.moneyTableData=d.list;
					}
				});
			},
			/**匹配得到billlmode的中文含义 */
			matchBillMode(value){
				for(let i=0;i<this._billmode.length;i++){
					if(this._billmode[i].value===value){
						return this._billmode[i].name;
					}
				}
			},
			/**收费类型选择 */
			headradioBtnchange_type(d){
				// console.log(d);
				this.totalSum.txt=d+'总额：';
				// this.totalSum.number=parseInt(Math.random()*1000+100);
				this.topTitle=d;
				let match={
					'报名退费':2,
					'商品退费':5,
					'订金退费':4
				};
				let billmode=match[d];
				
				this.resetSearchParam();//重置搜索条件

				this.searchListParam.billMode=billmode;
				this.updateMoneyList();
				
			},
			/**收款人-下拉选择 */
			payeeSelectChange(d){
				// console.log(d);
				this.searchListParam.accountUserId=d||'';
				// this.updateMoneyList();
			},
			/**搜索条件清空 */
			inputKeyWordsClear(){
				this.searchListParam.keyName='';
				// this.updateMoneyList();
			},
			/**查询按钮点击 */
			queryBtnClick(){
				let keywords=this.headControls.param;
				this.searchListParam.keyName=keywords;
				this.updateMoneyList();
			},
			/**时间切换 */
			timeselectchange(d){
				//自定义时间选取
				if(d==='自定义'){
					this.$refs.selfTime.focus();
					this.headControls.timeselect.radio=this.headControls.timeselect.pre_radio;
					return;
				}
				let timeobj;
				if(d=='今日'){
					timeobj=tool.getTimeObjByType(1);
				}
				else if(d=='本周'){
					timeobj=tool.getTimeObjByType(2);
				}
				else if(d=='本月'){
					timeobj=tool.getTimeObjByType(3);
				}
				this.headControls.timeselect.pre_radio=d;
				this.searchListParam.startTime=timeobj.startTime;
				this.searchListParam.endTime=timeobj.endTime;
				this.updateMoneyList();//收费列表
			},
			/**自定义时间 */
			updateSelfTime(d){
				if(!d)return;
				this.headControls.timeselect.radio='自定义';
				let start=formateDate(d[0]),end=formateDate(d[1]);
				this.searchListParam.startTime=start;
				this.searchListParam.endTime=end;
				this.updateMoneyList();//收费列表
				function formateDate(t=new Date()){
					let year=t.getFullYear();
					let month=t.getMonth()+1;
					month=month<10?'0'+month:month;
					let day=t.getDate();
					day=day<10?'0'+day:day;
					let hour=t.getHours();
					hour=hour<10?'0'+hour:hour;
					let minute=t.getMinutes();
					minute=minute<10?'0'+minute:minute;
					let second=t.getSeconds();
					second=second<10?'0'+second:second;
					return year+'-'+month+'-'+day+' '+hour+':'+minute+':'+second;
				}
			},
			/**表格 行查看点击 */
			moneyTableRowClick(d){
				// console.log(d)
				this.moneyDetailsPopup.visible=true;
				let type=this.headradioBtn_type.radio;
				this.showChargesPopup(type,d,1);
			},
			/**审核 */
			checkTableRow(d){
				//简略小弹窗
				// this.checkPopup.visible=true;
				// this.checkPopup.orderNo=d.orderRefundEntity.orderRefundId;
				// this.checkPopup.money=d.realMoney;
				// this.checkPopup.payee=d.createUserName;
				// this.checkPopup.orderRefundId=d.orderRefundEntity.orderRefundId;

				//在收退费详情页审核
				this.moneyDetailsPopup.visible=true;
				let type=this.headradioBtn_type.radio;
				this.showChargesPopup(type,d,2);
			},
			/**表格翻页 */
			handleCurrentChange(val) {
				this.updateMoneyList(val);
			},
			/**切换每页个数 */
			handleSizeChange(val){
				this.searchListParam.pageSize=val;
				this.updateMoneyList();
			},
			/**显示收费、退费管理弹窗 */
			showChargesPopup(type,data,operationType){
				if(!data)return;
				if(!data.refundCourseData)data.refundCourseData=[];
				this.moneyDetailsPopup.operationType=operationType;
				if(operationType==1){
					this.moneyDetailsPopup.title='退费详情';
				}
				else if(operationType==2){
					this.moneyDetailsPopup.title='退费审核';
				}
				let fields=this.getFieldsNameInChargesPopup(type);
				let match={
					2:'现金退款',
					3:'微信退款',
					4:'支付宝退款',
					1:'银联退款',
					5:'POS机退款',
					100:'原路返回'
				};
				let param={
					//收退费类型
					moneyType:type,
					//操作：1-查看/2-审核
					operationType:operationType,
					title:{
						row1:'学员信息',
						row2:fields.title2
					},
					studentInfo:{
						row1_clo1:{
							name:'学员姓名：',
							value:data.studentName
						},
						row1_clo2:{
							name:'联系人：',
							value:data.parentName
						},
						row1_clo3:{
							name:'联系电话：',
							value:data.studentPhone
						},
						row1_clo4:{
							name:fields.studentInfo.row1_clo4,
							value:data.createTime
						},
						row2_clo1:{
							name:fields.studentInfo.row2_clo1,
							value:data.payeeName
						},
						row2_clo2:{
							visible:true,
							name:fields.studentInfo.row2_clo2,
							value:data.payeeTel
						}
					},
					tableObj:{
						type:type,
						statistics:{
							'row1':{
								name:fields.tableObj.row1,
								value:''
							},
							'row2':{
								name:fields.tableObj.row2,
								value:data.realMoney
							},
							'row3':{
								visible:false,
								name:fields.tableObj.row3,
								value:'测试'
							}
						},
						table:{
							thead:[],
							tbody:[]
						}
					},
					otherIfo:{
						row1:{
								name:fields.otherIfo.row1,
								value:match[data.payMode]||''
						},
						row2:{
								name:fields.otherIfo.row2,
								value:data.executeUserName
						},
						row3:{
								name:fields.otherIfo.row3,
								value:data.createUserName
						},
						row4:{
								name:fields.otherIfo.row4,
								value:data.refundRemark
						},
						row5:{
								name:'订单号：',
								value:''//data.orderRefundEntity.orderRefundId
						},
						row6:{
								name:'第三方订单号：',
								value:''//data.orderRefundEntity.payOrderNo
						},
						row7:{
								name:'订单状态：',
								value:'已退款'
						},
					}
				};
				if(type=='报名退费'){
					if(data.orderRefundEntity){
						param.otherIfo['row5'].value=data.orderRefundEntity.orderRefundId;//订单号
						param.otherIfo['row6'].value=data.orderRefundEntity.payOrderNo;//第三方订单号
					}
					//退费状态
					let statu8='';
					if(data.orderRefundState==1)statu8='待审核';
					else if(data.orderRefundState==2)statu8='已退款';
					else if(data.orderRefundState==3)statu8='退费驳回';
					param.otherIfo.row7.value=statu8;

					param.tableObj.table.thead=[
						{propName:'clo1',labelNmae:'名称'},
						{propName:'clo2',labelNmae:'收费模式'},
						{propName:'clo3',labelNmae:'购买课时'},
						{propName:'clo4',labelNmae:'课程单价'},
						{propName:'clo5',labelNmae:'课程总价'},
						{propName:'clo6',labelNmae:'实际支付'},
						{propName:'clo7',labelNmae:'已上课时'},
						{propName:'clo8',labelNmae:'课耗'},
						{propName:'clo9',labelNmae:'剩余课时'},
						{propName:'clo10',labelNmae:'剩余课程费用'},
						{propName:'clo11',labelNmae:'应退费'},
					];
					param.tableObj.table.tbody=[];
					let sum=0;
					for(let i=0;i<data.refundCourseData.length;i++){
						let row=data.refundCourseData[i];
						param.tableObj.table.tbody.push({
							clo1:row.courseName,clo2:row.chargeModeName,clo3:row.buyHour,clo4:'￥'+row.courseOnePrice,
							clo5:'￥'+row.courseTotalPrice,clo6:'￥'+row.realMoney/*realPayMoney*/,clo7:row.useClassHour,clo8:'￥'+row.useMoney,
							clo9:row.surplusClassHour,clo10:'￥'+row.surplusMoney,clo11:'￥'+row.refundMeoey
						});
						sum+=row.refundMeoey;
					}
					param.tableObj.statistics.row1.value=sum;
				}
				else if(type=='商品退费'){
					if(data.orderRefundEntity){
						param.otherIfo['row5'].value=data.orderRefundEntity.orderRefundId;//订单号
						param.otherIfo['row6'].value=data.orderRefundEntity.payOrderNo;//第三方订单号
					}
					param.tableObj.table.thead=[
						{propName:'clo1',labelNmae:'名称'},
						{propName:'clo2',labelNmae:'商品分类'},
						{propName:'clo3',labelNmae:'商品单价'},
						{propName:'clo4',labelNmae:'购买数量'},
						{propName:'clo5',labelNmae:'总价'},
						{propName:'clo6',labelNmae:'实际支付'},
						{propName:'clo7',labelNmae:'需退数量'},
						{propName:'clo8',labelNmae:'应退费'}
					];
					param.tableObj.table.tbody=[];
					
					let goosModeMatch=tool.parseDict(this._dictData.goods_mode);
					let sum=0;
					for(let i=0;i<data.refundGoodsData.length;i++){
						let row=data.refundGoodsData[i];
						param.tableObj.table.tbody.push({
							// classmode:'商品',
							clo1:row.goodsName,
							clo2:goosModeMatch[row.goodsMode],
							clo3:'￥'+(row.goodsOneMoney||0),
							clo4:row.goodsNum,
							clo5:'￥'+(row.totalMoney||0),
							clo6:'￥'+(row.realMoney||0),
							clo7:row.goodsNum,
							clo8:'￥'+(row.realMoney||0),
						});
						sum+=row.totalMoney;
					}
					param.tableObj.statistics.row1.value=sum;
				}
				else{
					param.otherIfo['row5'].value=-1;//订单号
					param.otherIfo['row6'].value=-1;//第三方订单号
					
					param.tableObj.table.thead=[
						{propName:'clo1',labelNmae:'缴费时间'},
						{propName:'clo2',labelNmae:'订金'},
						{propName:'clo3',labelNmae:'实际支付'},
						{propName:'clo4',labelNmae:'应退费'}
					];
					param.tableObj.table.tbody=[];
					for(let i=0;i<5;i++){
						param.tableObj.table.tbody.push({
							clo1:'2019.04.05 10:30',clo2:'￥200',clo3:'￥200',clo4:'￥200'
						});
					}
				}
				if(!this.moneyDetailsPopup.data){
					this.moneyDetailsPopup.data=param;
				}
				else{
					this.$refs.chargespopup.updateByData(param)
				}
			},
			/**隐藏收退费详情（审核）弹窗 */
			hideChargesPopup(){
				this.moneyDetailsPopup.visible=false;
			},
			getFieldsNameInChargesPopup(type){
				let fields={
					title2:'',
					studentInfo:{},
					tableObj:{},
					otherIfo:{}
				};
				switch(type){
					case '全部收费':{
						fields.title2='收费详情';
						fields.studentInfo['row1_clo4']='缴费时间：';
						fields.studentInfo['row2_clo1']='合同号：';
						fields.studentInfo['row2_clo2']='';
						fields.tableObj['row1']='应收总计：';
						fields.tableObj['row2']='实际收款：';
						fields.tableObj['row3']='订金抵扣：';
						fields.otherIfo['row1']='缴费方式：';
						fields.otherIfo['row2']='跟单人：';
						fields.otherIfo['row3']='收款人：';
						fields.otherIfo['row4']='备注：';
						break;
					}
					case '报名收费':{
						fields.title2='报名详情';
						fields.studentInfo['row1_clo4']='报名缴费时间：';
						fields.studentInfo['row2_clo1']='合同号：';
						fields.studentInfo['row2_clo2']='';
						fields.tableObj['row1']='应收总计：';
						fields.tableObj['row2']='实际收款：';
						fields.tableObj['row3']='订金抵扣：';
						fields.otherIfo['row1']='缴费方式：';
						fields.otherIfo['row2']='跟单人：';
						fields.otherIfo['row3']='收款人：';
						fields.otherIfo['row4']='备注：';
						break;
					}
					case '商品收费':{
						fields.title2='商品详情';
						fields.studentInfo['row1_clo4']='购买时间：';
						fields.studentInfo['row2_clo1']='收据：';
						fields.studentInfo['row2_clo2']='';
						fields.tableObj['row1']='应收总计：';
						fields.tableObj['row2']='实际收款：';
						fields.tableObj['row3']='订金抵扣：';
						fields.otherIfo['row1']='缴费方式：';
						fields.otherIfo['row2']='跟单人：';
						fields.otherIfo['row3']='收款人：';
						fields.otherIfo['row4']='备注：';
						break;
					}
					case '订金收费':{
						fields.title2='订金详情';
						fields.studentInfo['row1_clo4']='订金缴费时间：';
						fields.studentInfo['row2_clo1']='收据：';
						fields.studentInfo['row2_clo2']='';
						fields.tableObj['row1']='应收总计：';
						fields.tableObj['row2']='实际收款：';
						fields.tableObj['row3']='订金抵扣：';
						fields.otherIfo['row1']='缴费方式：';
						fields.otherIfo['row2']='跟单人：';
						fields.otherIfo['row3']='收款人：';
						fields.otherIfo['row4']='备注：';
						break;
					}
					case '报名退费':{
						fields.title2='退费详情';
						fields.studentInfo['row1_clo4']='退款时间：';
						fields.studentInfo['row2_clo1']='收款人：';
						fields.studentInfo['row2_clo2']='收款人电话：';
						fields.tableObj['row1']='应退总计：';
						fields.tableObj['row2']='实际退款：';
						fields.tableObj['row3']='手动修改退费价格：';
						fields.otherIfo['row1']='退款方式：';
						fields.otherIfo['row2']='跟单人：';
						fields.otherIfo['row3']='退款人：';
						fields.otherIfo['row4']='退费原因：';
						break;
					}
					case '商品退费':{
						fields.title2='退费详情';
						fields.studentInfo['row1_clo4']='退款时间：';
						fields.studentInfo['row2_clo1']='收款人：';
						fields.studentInfo['row2_clo2']='收款人电话：';
						fields.tableObj['row1']='应退总计：';
						fields.tableObj['row2']='实际退款：';
						fields.tableObj['row3']='手动修改退费价格：';
						fields.otherIfo['row1']='退款方式：';
						fields.otherIfo['row2']='跟单人：';
						fields.otherIfo['row3']='退款人：';
						fields.otherIfo['row4']='退费原因：';
						break;
					}
					case '订金退费':{
						fields.title2='退费详情';
						fields.studentInfo['row1_clo4']='退款时间：';
						fields.studentInfo['row2_clo1']='收款人：';
						fields.studentInfo['row2_clo2']='收款人电话：';
						fields.tableObj['row1']='应退总计：';
						fields.tableObj['row2']='实际退款：';
						fields.tableObj['row3']='手动修改退费价格：';
						fields.otherIfo['row1']='退款方式：';
						fields.otherIfo['row2']='跟单人：';
						fields.otherIfo['row3']='退款人：';
						fields.otherIfo['row4']='退费原因：';
						break;
					}
				}
				return fields;
			},
			/**导出Excel按钮 */
			outputExcelBtnClick(){

			},
			/**退费审核 */
			checkOrders(){
				let self=this;
				api.setRefundAuditOrder({orderRefundId:this.checkPopup.orderRefundId}).then(function(d){
					// console.log(d);
					if(d.result=='操作成功'){
						self.$message({
							message: '操作成功！',
							type: 'success'
						});
						self.checkPopup.visible=false;
						self.updateMoneyList();
					}
					
				});
			},
		},
		mounted(){
			let dict=JSON.parse(tool.getItem(window.lsKey.dict));
			this._dictData=dict;
			this.init();
		},
		computed:{
			
		},
		watch:{

		}
	}
</script>

<style lang="scss">
	.refundmanage{
		.headradioBtn_type{
			// display: none;
			width: 8rem;
			position: absolute;
			top: -0.8rem;
			left: .45rem;
			.el-radio-button{
				margin-left: 0.5rem !important;
			}
			.el-radio-button.first{
				margin-left: 0rem !important;
			}
			.el-radio-button__inner{
				width: 1.2rem !important;
				// border-top: 0;
				// border-bottom: 0;
				height: 0.60rem !important;
				line-height: 0.25rem !important;
				font-size: 0.18rem !important;
				border: unset !important;
				border-radius:unset !important;
				background: unset !important;
				color: unset !important;
				line-height: 0.45rem !important;
				font-size: 0.2rem !important;
			}
			.el-radio-button__orig-radio:checked + .el-radio-button__inner{
				box-shadow:unset !important;
				font-weight: bold !important;
				border-bottom: 0.03rem solid #3885f8 !important;
			}
		}
		.content{
			margin:  0 auto;
			min-width: 15.48rem;
			width: 15.48rem;
			.t-title{
				margin-top: 0.34rem;
				font-size: 0.25rem;
				font-weight: bold;
			}
			.tablebox{
				width: 15.48rem;
				margin-top: 0.14rem;
				padding: 0.2rem 0.32rem 0.2rem 0.32rem;
				height: auto;
				background: #fff;
				border: 0.01rem solid #ededed;
				border-radius: 0.10rem;
				box-shadow: 0 0.02rem 0.38rem 0 #3885f81f, 0 0 0.06rem 0 #3885f81f;
				.headcontrolsbox{
					position: relative;
					width: 100%;
					height: 0.6rem;
					display: flex;
					align-items: center;
					.left{
						width: 50%;
						.payeeselect{
							width: 2rem;
						}
						.paraminput{
							width: 3rem;
						}
						.query{
							
						}
					}
					.right{
						width: 50%;
						text-align: right;
						.timeselect{
							.el-radio-button__orig-radio:checked + .el-radio-button__inner{
									color: #3885f8;
									font-weight: bold;
									background: #FFFFFF;
									border: 0.01rem solid #DCDFE6;
									-webkit-box-shadow: 0.00rem 0 0 0 #FFFFFF;
									box-shadow: 0.00rem 0 0 0 #FFFFFF;
							}
						}
						.el-date-editor{
							right: -2.95rem;
							width: 0.85rem;
							height: 0.39rem;
							pointer-events: none;
							opacity: 0;
						}
					}
				}
				.moneyTable{
					.cell{
						text-align: center;
					}
				}
				.bottomControlsBox{
					width: 100%;
					height: 0.5rem;
					display: flex;
    				align-items: flex-end;
					.el-pagination{
						float: left;
						width: 50%;
						text-align: right;
						// margin-top: 0.14rem;
					}
					.totalBox{
						float: left;
						width: 50%;
						.txt{
							font-size: 0.2rem;
							font-weight: 500;
							color: #666666;
						}
						.unit{
							font-size: 0.3rem;
							font-weight: 600;
							color: rgb(252,115,0)
						}
						.number{
							font-size: 0.3rem;
							font-weight: 600;
							color: rgb(252,115,0)
						}
					}
				}
				
			}
			.chargespopup{
				.el-dialog{
					width: 11.84rem !important;
					background-color: white !important;
					border-radius: 0.1rem !important;
					.el-dialog__header{
						.el-dialog__title{
							font-size: 0.22rem !important;
							color: #333333 !important;
							padding: 0rem 0.1rem 0rem 0.1rem;
							font-weight: bold;
						}
					}
					.el-dialog__body{
						font-size: 0.16rem !important;
						color: #666666 !important;
						padding: 0.2rem 0.3rem  !important;
					}
				}
			}
			.checkpopup{
				top: 0.81rem !important;
        		left: 2.1rem !important;
				.el-dialog {
					width: 4.5rem !important;
					.el-dialog__header{
						text-align: center;
						.el-dialog__title{
							font-size: 0.2rem;
							font-weight: bold;
						}
					}
					.el-dialog__body{
						padding: 0.1rem 0.5rem !important;
						font-size: 0.16rem !important;
						.el-row{
							margin-top: 0.05rem;
						}
					}
					.el-dialog__footer{
						text-align: center !important;
					}
				}
			}
		}
		

		//鼠标悬浮
		.hoverpointer:hover{
			cursor: pointer;
		}
		// 滚动条
		.scrollbarstyle::-webkit-scrollbar {
			width: 0.05rem;
		}
		.scrollbarstyle::-webkit-scrollbar-thumb {
			border-radius: 0.5rem;
			background: #BBBBBB;
		}
		.scrollbarstyle::-webkit-scrollbar-track {
			background: #F2F6FC;
		}
		.el-table__body-wrapper::-webkit-scrollbar {
			width: 0.05rem;
		}
		.el-table__body-wrapper::-webkit-scrollbar-thumb {
			border-radius: 0.5rem;
			background: #BBBBBB;
		}
		.el-table__body-wrapper::-webkit-scrollbar-track {
			background: #F2F6FC;
		}
	}
	// 搜索框样式
	.comSearchInput .el-input__inner {
		background-color: #f7f8fa;
		border-radius: 0.08rem;
		font-size: 0.16rem;
		color: #666666;
		height: 0.36rem !important;
		line-height: 0.36rem !important;
	}
</style>